var layerId;
$(function(){
	$("#search-button").click(function(){
		var keyword=$("input[name='keyword']").val();
		var url=basePath+"/goodsBrand/searchGoodsBrand.shtml?pageNo=1&keyword="+keyword;
		window.location.href=url;
	});
	
	$("#add-button").click(function(){
		openEdit(0);
	});
	
})

function openEdit(brandId){
	layerId=layer.open({
		title: "编辑品牌",
		area: ['40%','40%'],
		fix:true,
		type: 2,
		content: basePath+'/goodsBrand/edit.shtml?brandId='+brandId
	});
}
function deleteFun(brandId){
	if(confirm("确认删除？")){
		 $.ajax({
	  		 url:basePath+"/goodsBrand/deleteGoodsBrand.shtml?brandId="+brandId,  
	  		 type:"post",
	  		 dataType:"JSON",
	  		 success:ajaxSuccessRefreshFun
	  	 });
	}
}
function fanye(pageNo){
	var keyword=init.keyword;
	var url=basePath+"/goodsBrand/searchGoodsBrand.shtml?pageNo="+pageNo+"&keyword="+init.keyword;
	window.location.href=url;
}
